import { ref, computed } from 'vue'
import { defineStore, acceptHMRUpdate } from 'pinia'

/**
 * 用户储存
 */
export const noticStore = defineStore('notic', () => {
    //记录模拟考试试卷的index
    const mockInfo = ref([])
    //记录正式考试试卷的index
    const examInfo = ref([])
    //记录专项练习的index和题目答案
    const myExerInfo = ref([])
    //记录基础练习的index和题目答案
    const baseExerInfo = ref([])
    //定义字体大小变量
    const fontSize = ref('middle')
    // 存储系统反馈下拉框数据
    const feedbackList = ref([])
    // actions 设置字体大小
    const setFontSize = (value: string) => {
        fontSize.value = value
    }
    const getFontSize = () => {
        return fontSize.value
    }
    const setFeedbackList = (value: []) => {
        feedbackList.value = value
    }
    const getFeedbackList = () => {
        return feedbackList.value
    }

    return { mockInfo, examInfo, fontSize, myExerInfo, baseExerInfo, feedbackList, setFontSize, getFontSize, setFeedbackList, getFeedbackList }
}, {
    persist: {
        enabled: true
    }
})

if (import.meta.hot) {
    import.meta.hot.accept(acceptHMRUpdate(noticStore, import.meta.hot))
}